package com.wnxy.sk.product.controller;


import com.wnxy.sk.common.result.Result;
import com.wnxy.sk.product.entity.ProductCover;
import com.wnxy.sk.product.entity.ProductDetail;
import com.wnxy.sk.product.service.IProductCoverService;
import com.wnxy.sk.product.service.IProductDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品详情 前端控制器
 * </p>
 *
 * @author Jet
 * @since 2022-10-11
 */
@RestController
@RequestMapping("/product-detail")
@Api(tags = "商品详情展示接口")
public class ProductDetailController {
    @Autowired
    private IProductDetailService productDetailService;

    @GetMapping("/{productId}")
    @ApiOperation("根据商品id查询详情")
    public Result findByProductId(@PathVariable("productId")Integer productId) {
        List<ProductDetail> list = productDetailService.findByProductId(productId);
        return Result.ok(list);
    }
}

